from .utils import *

# 获取电影所在地即各个所在地的个数
def getMapData():
    countryList = typeList2('country')
    countryObj = {}
    for i in countryList:
        if countryObj.get(i, -1) == -1:
            countryObj[i] = 1
        else:
            countryObj[i] = countryObj[i] + 1
    return list(countryObj.keys()), list(countryObj.values())

# 获取电影的语言即各语言的电影个数
def getLangData():
    langList = typeList2('lang')
    langObj = {}
    for i in langList:
        if langObj.get(i, -1) == -1:
            langObj[i] = 1
        else:
            langObj[i] = langObj[i] + 1
    return list(langObj.keys()), list(langObj.values())
# test
# print(getMapData())
# print(getLangData())